Name:		ccache
Version:	4.6
Release:	1%{?dist}
Summary:	compiler cache

License:	GPLv3
URL:		https://ccache.dev
Source0:	https://github.com/ccache/ccache/releases/download/v%{version}/ccache-%{version}.tar.xz

BuildRequires:	gcc-c++ zstd ninja

%description
Ccache is a compiler cache. It speeds up recompilation by caching previous
compilations and detecting when the same compilation is being done again.

%prep
%setup -q


%build
mkdir build
cd build
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%{_prefix} -DREDIS_STORAGE_BACKEND=OFF ..
ninja

%install
cd build
DESTDIR=%{buildroot} ninja install
install -d %{buildroot}/%{_libdir}/ccache/bin
ln -sf %{_bindir}/ccache %{buildroot}/%{_libdir}/ccache/bin/gcc
ln -sf %{_bindir}/ccache %{buildroot}/%{_libdir}/ccache/bin/g++
ln -sf %{_bindir}/ccache %{buildroot}/%{_libdir}/ccache/bin/clang
ln -sf %{_bindir}/ccache %{buildroot}/%{_libdir}/ccache/bin/clang++
ln -sf %{_bindir}/ccache %{buildroot}/%{_libdir}/ccache/bin/cc
ln -sf %{_bindir}/ccache %{buildroot}/%{_libdir}/ccache/bin/c++

%files
%license LICENSE.adoc
%{_bindir}/ccache
%{_libdir}/ccache/bin

%changelog

